package co.fitstart.entity.order;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 
 * @author mohanlan
 *
 */
@Entity
@Table(name = "moyu_address")
@DynamicUpdate
@JsonIgnoreProperties(value={"hibernate_lazy_initializer","handler","fieldHandler"})
public class MoyuAddress {
    
    @Id
    @GeneratedValue
    private Long id;
    
    private String name;
    
    private String mobile;
    
    private String pcd;
    
    private String address;
    
    private String openid;
    
    @Column(name = "is_default")
    private boolean remarked;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    public MoyuAddress() {
        // TODO Auto-generated constructor stub
    }
    
    public MoyuAddress(MoyuOrder moyuOrder) {
        this.name = moyuOrder.getName();
        this.mobile = moyuOrder.getMobile();
        this.pcd = moyuOrder.getPcd();
        this.address = moyuOrder.getAddress();
        this.openid = moyuOrder.getOpenid();
        this.remarked = true;
        this.disabled = false;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the mobile
     */
    public String getMobile() {
        return mobile;
    }

    /**
     * @return the pcd
     */
    public String getPcd() {
        return pcd;
    }

    /**
     * @return the address
     */
    public String getAddress() {
        return address;
    }

    /**
     * @return the openid
     */
    public String getOpenid() {
        return openid;
    }

    /**
     * @return the remarked
     */
    public boolean isRemarked() {
        return remarked;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param mobile the mobile to set
     */
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    /**
     * @param pcd the pcd to set
     */
    public void setPcd(String pcd) {
        this.pcd = pcd;
    }

    /**
     * @param address the address to set
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * @param openid the openid to set
     */
    public void setOpenid(String openid) {
        this.openid = openid;
    }

    /**
     * @param remarked the remarked to set
     */
    public void setRemarked(boolean remarked) {
        this.remarked = remarked;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
}
